package com.koalac.ironman.util;

import java.util.Locale;

public class UUID {
	/**
	 * UUID长度1
	 */
	public final static int UUIDLength1 = 32;
	/**
	 * UUID长度2
	 */
	public final static int UUIDLength2 = 36;

	public UUID() {
	}

	/**
	 * 获得一个大写的UUID
	 * 
	 * @return String UUID
	 */
	public static String getUpperCaseUUID() {
		String s = uuidBaseTime().toUpperCase(Locale.getDefault());
		return s.replace("-", "");
	}

	/**
	 * 获得一个小写的UUID
	 * 
	 * @return String UUID
	 */
	public static String getLowerCaseUUID() {
		String s = uuidBaseTime().toLowerCase(Locale.getDefault());
		return s.replace("-", "");
	}

	/**
	 * 取得基于时间的UUID
	 * 
	 * @return
	 */
	public static String uuidBaseTime() {
		return java.util.UUID.randomUUID().toString();
	}
}
